home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / bipl.zip / PROCS.ZIP / PROCKIND.ICN < prev    next >
Text File  |  1992-09-28  |  915b  |  37 lines

  1. ############################################################################
  2. #
  3. #    File:     prockind.icn
  4. #
  5. #    Subject:  Procedure to produce code according to kind of procedure
  6. #
  7. #    Author:   Ralph E. Griswold
  8. #
  9. #    Date:     September 17, 1992
  10. #
  11. ###########################################################################
  12. #
  13. #  prockind(p) produces a code for the kind of the procedure p as follows:
  14. #
  15. #    "p"    (declared) procedure
  16. #    "f"    (built-in) function
  17. #    "o"    operator
  18. #    "c"    record constructor
  19. #
  20. #  It fails if p is not of type procedure.
  21. #
  22. ############################################################################
  23.  
  24. procedure prockind(p)
  25.  
  26.    if type(p) ~== "procedure" then fail
  27.  
  28.    image(p) ? {
  29.       if find("procedure") then return "p"
  30.       if find("record constructor") then return "c"
  31.       ="function "
  32.       if upto(&letters) then return "f" else return "o"
  33.       }
  34.  
  35. end
  36.  
  37.